#!/bin/sh

# 设置环境变量
export GITHUB_REVIEW_LOG_URI="https://github.com/CQmessi/code-review-log.git"
export GITHUB_TOKEN="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"
export COMMIT_PROJECT="test"
export COMMIT_BRANCH="main"
export COMMIT_AUTHOR=$(git log -1 --pretty=format:'%an')
export COMMIT_MESSAGE=$(git log -1 --pretty=format:'%s')
export GIT_URL="https://gitee.com/pbkdbhw/review-log"
export GIT_USER="pbkdbhw"
export GIT_PASSWORD="96b749c47e8428270635d9e63b2e3ea3"
export GIT_FILE_ADDRESS="https://gitee.com/pbkdbhw/review-log/blob/master"
export WEIXIN_APPID="wxa2ed7d39e5426b38"
export WEIXIN_SECRET="a2947b62c6ada9dd9a83171c7fc2119e"
export WEIXIN_TOUSER="opvStvuwwA9UgiVsRxNNC0wXqo-E"
export WEIXIN_TEMPLATE_ID="6ZV96SG3-EumBlO5XoLmXDw-9Ek1QirD2WVh1Jh3xHk"
export MODEL_KEY="ce7cc03a11f9456caa9bddc5cb9b3d45.Tawiyaa7QaxTKzUN"
export MODEL_URL="https://open.bigmodel.cn/api/paas/v4/chat/completions"
export MODEL="deepseek-ai/DeepSeek-R1-0528-Qwen3-8B"

echo "正在执行代码审查..."
cd "/e/study/model/review-test/demo"
mvn compile exec:java -Dexec.mainClass="com.zhangjun.openaicodesdk.CodeReviewer"
if [ $? -ne 0 ]; then
    echo "代码审查执行失败，请检查错误信息"
    exit 1
fi
echo "代码审查完成"